package com.lemon.smartsafety.rayeye.util;

import com.lemon.smartsafety.utils.common.StringUtils;

/**
 * Created by Cooliean on 16/4/16.
 */
public interface RayType {
    public CharSequence getCharSeq();

    public int getValue();

    enum ListType implements RayType {
        /**
         * 故障
         */
        FAULT(0)
        /**
         * 火警
         */
        , FIRE(1);

        int value;

        ListType(int type) {
            this.value = type;
        }

        @Override
        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        @Override
        public CharSequence getCharSeq() {
            CharSequence result = "";
            switch (getValue()) {
                case 0: {
                    result = StringUtils.getStatusString("故障", StringUtils.ColorStatus.STATUS_COMMON);
                    break;
                }
                case 1: {
                    result = StringUtils.getStatusString("火警", StringUtils.ColorStatus.STATUS_COMMON);
                    break;
                }
            }
            return result;
        }

        @Override
        public String toString() {
            String result = "";
            switch (getValue()) {
                case 0: {
                    result = "故障";
                    break;
                }
                case 1: {
                    result = "火警";
                    break;
                }
            }
            return result;
        }
    }

    //0未确认 1物业已报修  2 忽略   3 维修中 4已屏蔽  5已维修
    enum FaultItemType implements RayType {
        /**
         * 0 未确认
         */
        NOT_CONFIRM(0),
        /**
         * 1 物业已报修
         */
        WU_YE_REPAIR(1),
        /**
         * 2 忽略
         */
        IGNORED(2),
        /**
         * 3 维修中
         */
        REPAIRING(3),
        /**
         * 4 已屏蔽
         */
        BLOCKED(4),
        /**
         * 5 已维修
         */
        REPAIRED(5);
        int value;

        FaultItemType(int type) {
            this.value = type;
        }

        @Override
        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        @Override
        public CharSequence getCharSeq() {
            CharSequence result = "";
            switch (getValue()) {
                case 0: {
                    result = StringUtils.getStatusString("未确认", StringUtils.ColorStatus.STATUS_RED);
                    break;
                }
                case 1: {
                    result = StringUtils.getStatusString("物业已报修", StringUtils.ColorStatus.STATUS_BLUE);
                    break;
                }
                case 2: {
                    result = StringUtils.getStatusString("忽略", StringUtils.ColorStatus.STATUS_GRAY);
                    break;
                }
                case 3: {
                    result = StringUtils.getStatusString("维修中", StringUtils.ColorStatus.STATUS_GREEN);
                    break;
                }
                case 4: {
                    result = StringUtils.getStatusString("已屏蔽", StringUtils.ColorStatus.STATUS_GRAY);
                    break;
                }
                case 5: {
                    result = StringUtils.getStatusString("已维修", StringUtils.ColorStatus.STATUS_GREEN);
                    break;
                }
            }
            return result;
        }

        @Override
        public String toString() {
            String result = "";
            switch (getValue()) {
                case 0: {
                    result = "未确认";
                    break;
                }
                case 1: {
                    result = "物业已报修";
                    break;
                }
                case 2: {
                    result = "忽略";
                    break;
                }
                case 3: {
                    result = "维修中";
                    break;
                }
                case 4: {
                    result = "已屏蔽";
                    break;
                }
                case 5: {
                    result = "已维修";
                    break;
                }
            }
            return result;
        }
    }

    //0 未处理，1 已确认，2 已忽略
    enum FireItemType implements RayType {
        NOT_HANDLE(0), CONFIRM(1), IGNORED(2);
        int value;

        FireItemType(int type) {
            this.value = type;
        }

        @Override
        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        @Override
        public CharSequence getCharSeq() {
            CharSequence result = "";
            switch (getValue()) {
                case 0: {
                    result = StringUtils.getStatusString("未处理", StringUtils.ColorStatus.STATUS_RED);
                    break;
                }
                case 1: {
                    result = StringUtils.getStatusString("已确认", StringUtils.ColorStatus.STATUS_GREEN);
                    break;
                }
                case 2: {
                    result = StringUtils.getStatusString("已忽略", StringUtils.ColorStatus.STATUS_GRAY);
                    break;
                }
            }
            return result;
        }

        @Override
        public String toString() {
            String result = "";
            //0 未处理，1 已确认，2 已忽略
            switch (getValue()) {
                case 0: {
                    result = "未处理";
                    break;
                }
                case 1: {
                    result = "已确认";
                    break;
                }
                case 2: {
                    result = "已忽略";
                    break;
                }
            }
            return result;
        }
    }
}
